home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 October / EnigmA AMIGA RUN 31 (1998)(G.R. Edizioni)(IT)[!][issue 1998-10].iso / earkit / browser / aweb31_patch / install-aweb31 < prev    next >
Text File  |  1998-09-22  |  9KB  |  407 lines

  1. ; $VER: Install-AWeb31 0.2 (20.12.97)
  2. ; Description: Installer script for AWeb-II 3.0(b) -> 3.1 patch
  3.  
  4. (complete 0)
  5.  
  6. (set #welcome
  7.    (cat "This installation procedure installs the AWeb-II 3.1 patch on your system.\n\n"
  8.         "You must have installed AWeb-II 3.0(b) previously.\n\n"
  9.         "You will need the original AWeb-II 3.0 or 3.0b disks for this installation procedure."
  10.    )
  11. )
  12.  
  13. (set #no-aweb30 
  14.    (cat "AWeb3: assign not found.\nYou haven't properly installed AWeb-II 3.0(b).\n\n"
  15.         "The AWeb-II 3.1 patch is not applied."
  16.    )
  17. )
  18.  
  19. (set #ask-backup
  20.    "Do you want to make a backup copy of the currently installed version of AWeb-II?"
  21. )
  22.  
  23. (set #backup-help
  24.    (cat "If you select YES, a backup will be made of the executable files "
  25.         "that will be changed by this installation.\n"
  26.         "You will be prompted for a (preferrably new) drawer where to store "
  27.         "the files."
  28.    )
  29. )
  30.  
  31. (set #backup-prompt
  32.    "Select a location for the backup copy of the current files"
  33. )
  34.  
  35. (set #insert-disk1
  36.    (cat "Please insert disk 1 of the original AWeb-II 3.0 or 3.0b distribution "
  37.         "(AWeb3.0_Disk1) into any drive\n"
  38.    )
  39. )
  40.  
  41. (set #settingup "Setting up utilities")
  42. (set #patching "Patching %s\n\nBe patient, this can take a while...")
  43. (set #installing "Installing %s")
  44.  
  45. (set #invalid-version
  46.    (cat "Patch could not be performed.\n"
  47.         "The file '%s' has an invalid version. This patch can ONLY be applied "
  48.         "to AWeb-II version 3.0 or 3.0b\n\n"
  49.         "Installation procedure terminated."
  50.    )
  51. )
  52.  
  53. (set #ask_run
  54.    (cat "The first time you run AWeb again, you will have to re-enter "
  55.         "the serial number found on the original distribution, and your name.\n\n"
  56.         "Do you want to start AWeb now?"
  57.    )
  58. )
  59.  
  60. (set #ready "Installation of AWeb-II 3.0(b) -> 3.1 patch complete.")
  61.  
  62. ;===========================================================================
  63.  
  64. ;---- Procedure to extract 1 file from an archive into T: ----
  65.  
  66. (procedure P_extract #arc #file
  67.    
  68.    ; Build command like
  69.    ;  T:lhex -w=T: e AWeb3.0_Disk1:<#arc> <#file>
  70.    ;
  71.    ; extracts 1 file from the archive on the distribution disk into T:
  72.    (run
  73.       ("T:lhex -w=T: e AWeb3.0_Disk1:%s %s" #arc #file)
  74.    )
  75. )
  76.  
  77.  
  78. ;---- Procedure to get the checksum for a file in T: ----
  79.  
  80. (procedure P_getsum #file
  81.  
  82.    (getsum (tackon "T:" #file))
  83. )
  84.  
  85.  
  86. ;---- Procedure to patch 1 file (with checksum checked if it is supplied) ----
  87.  
  88. (procedure P_Patch1 #file #sum #pch
  89.  
  90.    (if (<> #sum "")
  91.       (
  92.          (if (<> #sum (P_getsum #file))
  93.             (
  94.                (delete (tackon "T:" #file))
  95.                (exit (#invalid-version #file) (quiet))
  96.             )
  97.          )
  98.       )
  99.    )
  100.    
  101.    ; Build command like
  102.    ;  T:spatch -p<path><#pch> -oAWeb3:<#file> T:<#file>
  103.    ;
  104.    ; patches the original file in T: using the .pch file building a new file in AWeb3:
  105.    (run
  106.       (cat
  107.          "T:spatch -p"
  108.          (tackon "AWeb31PATCH:" #pch)
  109.          (" -oAWeb3:%s T:%s" #file #file)
  110.       )
  111.    )
  112.  
  113.    ; Delete the original file from T:
  114.    (delete
  115.       (cat "T:" #file)
  116.    )
  117. )
  118.  
  119.  
  120. ;---- Procedure to extract and patch 1 file ----
  121.  
  122. (procedure P_patch #arc #file #sum #pch
  123.  
  124.    (working (#patching #file))
  125.    
  126.    (P_extract #arc #file)
  127.    
  128.    (P_patch1 #file #sum #pch)
  129. )
  130.  
  131.  
  132. ;---- Procedure to extract 1 file and patch it depending on checksum ----
  133.  
  134. ; If extracted program has checksum #sum2, patch #pch2 is applied first
  135. ; and the result is copied back to the location (T:) of the extracted progam.
  136. ; Then patch #pch1 is applied to the extracted (or in the 1st pass patched)
  137. ; program if its checksum matches #sum1.
  138. ;
  139. ; #complete percentage is increased by 3 * #dcomplete after completion.
  140.  
  141. (procedure P_patch_depending #arc #file #sum1 #pch1 #sum2 #pch2 #complete #dcomplete
  142.  
  143.    (working (#patching #file))
  144.    
  145.    (P_extract #arc #file)
  146.    
  147.    (set #sum (P_getsum #file))
  148.  
  149.    (complete (set #complete (+ #complete #dcomplete)))
  150.    
  151.    (if (= #sum #sum2)
  152.       (
  153.          (P_patch1 #file "" #pch2)
  154.          
  155.          (copyfiles
  156.             (source (tackon "AWeb3:" #file))
  157.             (dest "T:")
  158.             (nogauge)
  159.          )
  160.          
  161.          (set #sum (P_getsum #file))
  162.       )
  163.    )
  164.  
  165.    (complete (set #complete (+ #complete #dcomplete)))
  166.    
  167.    (if (= #sum #sum1)
  168.       (
  169.          (P_patch1 #file "" #pch1)
  170.       )
  171.       (
  172.          (delete (tackon "T:" #file))
  173.          (exit (#invalid-version #file) (quiet))
  174.       )
  175.    )
  176.  
  177.    (complete (set #complete (+ #complete #dcomplete)))
  178. )
  179.  
  180. ;===========================================================================
  181.  
  182. ;---- Display welcome message ----
  183.  
  184. (message #welcome)
  185.  
  186. ;---- Check the existence of AWeb3: assign ----
  187.  
  188. (if 
  189.    (not (exists "AWeb3:"))
  190.    (
  191.       (message #no-aweb30)
  192.       (exit (quiet))
  193.    )
  194. )
  195.  
  196. (set @default-dest (expandpath "AWeb3:"))
  197.  
  198. ;---- Ask for backup of current versions ----
  199.  
  200. (if
  201.    (askbool
  202.       (prompt #ask-backup)
  203.       (help #backup-help)
  204.    )
  205.    (
  206.       (set #backup
  207.          (askdir
  208.             (prompt #backup-prompt)
  209.             (help @askfile-help)
  210.             (default (tackon (expandpath "AWeb3:") "backup3.0"))
  211.             (newpath)
  212.          )
  213.       )
  214.       (if (not (exists #backup))
  215.          (
  216.             (makedir #backup)
  217.          )
  218.       )
  219.       
  220.       (copyfiles
  221.          (source "AWeb3:")
  222.          (choices "AWeb-II" "AWebCfg")
  223.          (dest #backup)
  224.          (optional "nofail")
  225.       )
  226.       
  227.       (copyfiles
  228.          (source "AWeb3:aweblib")
  229.          (all)
  230.          (dest (tackon #backup "aweblib"))
  231.          (optional "nofail")
  232.       )
  233.    )
  234. )
  235.  
  236. (complete 5)
  237.  
  238. ;---- Let the user insert the correct disk ----
  239.  
  240. (askdisk
  241.    (prompt #insert-disk1)
  242.    (help @askdisk-help)
  243.    (dest "AWeb3.0_Disk1")
  244. )
  245.  
  246. ;---- Copy required utilities to T: ----
  247.  
  248. (copyfiles
  249.    (prompt #settingup)
  250.    (help @copyfiles-help)
  251.    (source "AWeb3.0_Disk1:lhex")
  252.    (dest "T:")
  253. )
  254.  
  255. (copyfiles
  256.    (prompt #settingup)
  257.    (help @copyfiles-help)
  258.    (source (tackon (pathonly @icon) "spatch"))
  259.    (dest "T:")
  260. )
  261.  
  262. ; Make a temporary assign because the spatch utilitiy can't handle
  263. ; path names with a space
  264. (makeassign "AWeb31PATCH" (pathonly @icon))
  265.  
  266. (complete 10)
  267.  
  268. ;---- Patch AWeb-II ----
  269.  
  270. (P_patch_depending "aweb2.lha" "AWeb-II"
  271.    -1253492792 "AWeb30b-31.pch"
  272.    1498876731 "AWeb30-30b.pch"
  273.    10 10)
  274.  
  275. ;---- Patch AWebCfg ----
  276.  
  277. (P_patch_depending "aweb1.lha" "AWebCfg"
  278.    -1623681170 "AWebCfg30b-31.pch"
  279.    664509881 "AWebCfg30-30b.pch"
  280.    40 5)
  281.  
  282. ;---- Patch aweblib modules ----
  283.  
  284. (P_patch "aweb-lib-plug.lha" "aweblib/arexx.aweblib" -794496057 "arexx.pch")
  285.  
  286. (P_patch "aweb-lib-plug.lha" "aweblib/authorize.aweblib" -30568908 "authorize.pch")
  287.  
  288. (complete 60)
  289.  
  290. (P_patch "aweb-lib-plug.lha" "aweblib/cachebrowser.aweblib" 1795294701 "cachebrowser.pch")
  291.  
  292. (P_patch "aweb-lib-plug.lha" "aweblib/ftp.aweblib" 1459088783 "ftp.pch")
  293.  
  294. (P_patch "aweb-lib-plug.lha" "aweblib/gopher.aweblib" -1025195164 "gopher.pch")
  295.  
  296. (complete 65)
  297.  
  298. (P_patch "aweb-lib-plug.lha" "aweblib/history.aweblib" -1182279980 "history.pch")
  299.  
  300. (P_patch "aweb-lib-plug.lha" "aweblib/hotlist.aweblib" 491052913 "hotlist.pch")
  301.  
  302. ;---- Clean up ----
  303.  
  304. (delete "T:aweblib")
  305. (delete "T:lhex")
  306. (delete "T:spatch")
  307. (makeassign "AWeb31PATCH")
  308.  
  309. (complete 70)
  310.  
  311. ;---- Install new aweblib modules ----
  312.  
  313. (working (#installing "aweblib modules"))
  314.  
  315. (copyfiles
  316.    (source (tackon (pathonly @icon) "aweblib"))
  317.    (dest "AWeb3:aweblib")
  318.    (all)
  319. )
  320.  
  321. ;---- Installing AWebJS ----
  322.  
  323. (working (#installing "AWebJS"))
  324.  
  325. (copyfiles
  326.    (source (tackon (pathonly @icon) "AWebJS"))
  327.    (dest "AWeb3:")
  328. )
  329.  
  330. (complete 75)
  331.  
  332. ;---- Install new documentation ----
  333.  
  334. (working (#installing "documentation"))
  335.  
  336. (copyfiles
  337.    (source (tackon (pathonly @icon) "docs"))
  338.    (dest "AWeb3:docs")
  339.    (all)
  340. )
  341.  
  342. (complete 90)
  343.  
  344. ;---- Install new button set
  345.  
  346. (working (#installing "buttons"))
  347.  
  348. (if (exists "AWeb3:storage/buttons")
  349.    (
  350.       (copyfiles
  351.          (source (tackon (pathonly @icon) "storage/buttons"))
  352.          (dest "AWeb3:storage/buttons")
  353.          (all)
  354.       )
  355.    )
  356. )
  357.  
  358. ;---- Install new catalogs for those languages installed ----
  359.  
  360. (working (#installing "catalogs"))
  361.  
  362. (if (exists "AWeb3:catalogs")
  363.    (
  364.       (set #newcatalogs (tackon (pathonly @icon) "catalogs"))
  365.  
  366.       (foreach "AWeb3:catalogs" "#?"
  367.          (
  368.             (if (exists (tackon #newcatalogs @each-name))
  369.                (
  370.                   (copyfiles
  371.                      (source (tackon #newcatalogs @each-name))
  372.                      (dest (tackon "AWeb3:catalogs" @each-name))
  373.                      (all)
  374.                   )
  375.                )
  376.             )
  377.          )
  378.       )
  379.    )
  380. )
  381.  
  382. (complete 95)
  383.  
  384. ;---- Flush any existing aweblib modules from memory ----
  385.  
  386. (run "avail flush >NIL:")
  387.  
  388. ;---- Ask if AWeb should run now to enter the registration details ----
  389.  
  390. (if
  391.    (askbool
  392.       (prompt #ask_run)
  393.       (help @askbool-help)
  394.    )
  395.    (
  396.       (run "run AWeb3:AWeb-II local AWeb3:docs/history.html")
  397.    )
  398. )
  399.  
  400. (complete 100)
  401.  
  402. ;---- Ready ----
  403.  
  404. (exit #ready)
  405.  
  406.  
  407.